<template>
  <!-- 雷达图  图表必须给高和宽度-->
  <div ref="myDiv" class="radar-echart" />
</template>

<script>
var echarts = require('echarts/lib/echarts')
require('echarts/lib/chart/radar')
require('echarts/lib/component/tooltip')
require('echarts/lib/component/title')
import { LegendComponent } from 'echarts/components'
echarts.use([LegendComponent])
export default {
  mounted() {
    const myChart = echarts.init(this.$refs.myDiv)
    myChart.setOption({

      legend: {
        data: ['孙财', '管理员']
      },
      radar: {
        // shape: 'circle',
        indicator: [
          { name: '工作效率', max: 100 },
          { name: '考勤', max: 100 },
          { name: '积极性', max: 100 },
          { name: '帮助同事', max: 100 },
          { name: '自主学习', max: 100 },
          { name: '正确率', max: 100 }
        ]
      },
      series: [{
        name: '孙财 vs 管理员',
        type: 'radar',
        data: [
          {
            value: [80, 80, 100, 80, 100, 50],
            name: '孙财'
          },
          {
            value: [50, 50, 90, 50, 50, 90],
            name: '管理员'
          }
        ]
      }]
    })
  }

}
</script>

<style>
.radar-echart {
  width: 600px;
  height: 400px;
}
</style>

